#include<iostream>
#include"comm.hpp"

int main()
{
    int shmid=getSharmen();
    char* shmadder=(char*)shmat(shmid,nullptr,0);

    int fd=open(Filename,O_RDONLY);
    while(true)
    {
        char buf[10];
        ssize_t t1=read(fd,buf,sizeof(buf));
        if(t1==0)
        {
            break;
        }

        std::cout<<"client say# "<<shmadder;

        std::cout<<"I say#";
        fgets(shmadder,4096,stdin);
        ssize_t t2=read(fd,buf,sizeof(buf));
        if(t2==0)
        {
            break;
        }
    }

    int re=shmdt(shmadder);
    return 0;
}